package com.wang.system.config;

/**
 * @Author wang
 * @Date 2024/9/22 18:57
 * @PackageName:com.wang.system.config
 * @ClassName: TenantContext
 * @Description: TODO
 * @Version 1.0
 */
public class TenantContext {

    private static final ThreadLocal<String> TENANT_CONTEXT = new ThreadLocal<>();

    public static void setTenantId(String tenantId) {
        TENANT_CONTEXT.set(tenantId);
    }

    public static String getTenantId() {
        return TENANT_CONTEXT.get();
    }

    public static void clear() {
        TENANT_CONTEXT.remove();
    }
}
